package com.xuwenjin.basic_juc;

public class Demo1 extends Thread {
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());

    }

    public static void main(String[] args) {
        Demo1 demo1 = new Demo1();
        demo1.start();
        System.out.println(Thread.currentThread().getName());

        Thread thread = new Thread(new Demo2());
        thread.start();
    }
}

class Demo2 implements Runnable{

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
    }
}
